package com.ac.app.web.action.org;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ac.app.dm.OrgLink;
import com.ac.app.web.form.OrgLinkForm;
import com.caac.core.dm.User;
import com.caac.core.web.action.BaseAction;
import com.caac.core.web.form.BaseForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class SaveOrgLinkAction extends BaseAction {
	protected ActionForward doExecute(ActionMapping mapping, BaseForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		User user=this.getUserFromCache(request, response);
		OrgLinkForm myForm = (OrgLinkForm) form;
		OrgLink dm = myForm.getDm();
		dm.setInputTime(new Date());
		dm.setInputManId(user.getId());
		dm.setInputManName(user.getRealName());
		this.getBaseManager().saveObject(dm);
		return forward(mapping,new String []{dm.getOrgId()});
	}
}
